// pages/course/course.js

Page({

  /**
   * 页面的初始数据
   */
  //热门文章的接口：https://wwyy.wzhxlx.com/wwyy/article/getTopWeekChart?channelId=409&pageNo=1&pageSize=3&topType=1


  data: {
    articleList: '',
    swiperList: '',
   
  },
  onLoad: function (options) {
    let that = this;
    
    // 1.当页面加载后，就调用后端接口，来动态的获取热门文章作为轮播图效果
    wx.request({
      url: 'http://localhost:8080/article/findAll',
      data:{
        pageNum:1,
        pageSize:3
      },
      success(res) {
        //console.log(res.data.data.list);
        that.setData({
          swiperList: res.data.data.list
        })
      }
    })
    wx.request({
      url: 'http://localhost:8080/article/findAll',
      data:{
        pageNum:2,
        pageSize:3
      },
      success(res) {
        //console.log(res.data.data.list);
        that.setData({
          articleList: res.data.data.list
        })
      }
    })
  },
  handleContact (e) {
},
  toSearch() {
    wx.navigateTo({
      url: './search/search',

    })
  },

  toAccept() {
    wx.navigateTo({
      url: './accept/accept',

    })
  },

  topsy() {
    wx.navigateTo({
      url: './HomeNav/psy/psy',
    })
  },
 tomore(){
   wx.navigateTo({
     url: './articles/articles',
   })
 },
  
  toconsulation() {
    wx.navigateTo({
      url: './HomeNav/psy/consultation/consultation',
    })
  },

  toAQ() {
    wx.navigateTo({
      url: './HomeNav/PsychologicalAQ/PsychologicalAQ',

    })
  },

  toKnowledge() {
    wx.navigateTo({
      url: './HomeNav/psychologicalKnowledge/psychologicalKnowledge',

    })
  },

  toPublicWelfareCenter() {
    wx.navigateTo({
      url: './HomeNav/publicWelfareCenter/publicWelfareCenter',

    })
  },
  toFM() {
    wx.navigateTo({
      url: './HomeNav/FM/fm',

    })
  }
})